package cn.edu.gdut.deepcode.exception_handler;

import cn.edu.gdut.deepcode.domain.po.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * <p>
 * </p>
 *
 * @Author: 暮倦
 * @Since: 2025-04-13  22:51
 * @Version: 1.0.0
 */
@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public Result<?> globalExceptionHandler(Exception e){
        log.error("服务器发生错误",e);
        return Result.error();
    }
}


